;
(function($) {
	
	var maskMove = function(obj){
		var that = this;
		var w = obj.width(),
			h = obj.height(),
			posX = w/2,
			posY = h/2;z
			
		var img = obj.children("img"),
			imgW = img.width(),
			imgH = img.height();
		this.eleCssInit(obj, {
			width: imgW,
			height: imgH
		});



		
		
		var mask = $('<div class="mask"></div>');
		this.eleCssInit(mask, {
			width: imgW,
			height: imgH,
			backgroundColor: "rgba(0, 0, 0, 0.2)"
		});
		obj.append(mask);
		
		var eventType = "",
			direct = "";
		
		obj.on("mouseenter mouseleave", function(e){
			var mouseX = e.offsetX,
				mouseY = e.offsetY;
			
			var deg = Math.atan((posX - mouseX)/(posY - mouseY)) * 180 / Math.PI;
			if (deg > -45 && deg < 45 && mouseY > posY) {
				direct = "bottom";
			}
			if (deg > -45 && deg < 45 && mouseY < posY) {
				direct = "top";
			}
			if (((deg < -45 && deg > -90) || (deg > 45 && deg < 90)) && mouseX < posX) {
				direct = "left";
			}
			if (((deg < -45 && deg > -90) || (deg < 90 && deg > 45)) && mouseX > posX) {
				direct = "right";
			}
			
		});
	};
	
	maskMove.prototype = {
		eleCssInit: function(obj, cssArr){
			obj.css(cssArr);
		}
		
		
	};
	
	maskMove.init = function(objArr){
		var that = this;
		objArr.each(function(){
			new that($(this));
		})
	}
	
	window["maskMove"] = maskMove;
	
})(jQuery);